package data

import (
	"fmt"

	"github.com/treelab/updatecolumn/models"
)

func GetPopulateEmptyCellsQuery(pageSize int, offset int) string {
	return fmt.Sprintf(`
		{
			tables(func:type(TABLE), first:%d, offset:%d) {
				uid
				rows: has_row {
					uid
					cells: has_cell {
						rowId
						columnId
					}
				}
				columns: has_column {
					uid
					isDefault
					columnType
				}
			}
		}
	`,
		pageSize, offset)
}

type PopulateEmptyCellsResult struct {
	Tables []models.Table
}
